
Partial Class Modules_Questionnaires_Controls_cfgTime
    Inherits System.Web.UI.UserControl
    Implements DotNetPM.Business.Questionnaire.UserControls.IConfigUC

    Private _AnswerType As Integer

    Public Property AnswerType() As Integer Implements DotNetPM.Business.Questionnaire.UserControls.IConfigUC.AnswerType
        Get
            Return _AnswerType
        End Get
        Set(ByVal value As Integer)
            _AnswerType = value
        End Set
    End Property

    Public Property Config() As String Implements DotNetPM.Business.Questionnaire.UserControls.IConfigUC.Config
        Get
            Dim build As New StringBuilder
            build.Append(_AnswerType)
            build.Append("||" & rRequired.SelectedIndex)
            build.Append("||" & ddlTimeType.SelectedIndex)
            build.Append("||" & ddlMinuteInterval.SelectedValue)
            Return build.ToString
        End Get
        Set(ByVal value As String)
            Dim val As String() = Split(value, "||")
            _AnswerType = val(0)
            Integer.TryParse(val(1), rRequired.SelectedIndex)
            Integer.TryParse(val(2), ddlTimeType.SelectedIndex)
            Dim _minuteInterval As Integer
            Integer.TryParse(val(3), _minuteInterval)
            ddlMinuteInterval.SelectedItem.Selected = False
            ddlMinuteInterval.Items.FindByValue(_minuteInterval).Selected = True
            'Response.Write(_minuteInterval & " From Property <br/>")
        End Set
    End Property

    Public Sub Reset() Implements DotNetPM.Business.Questionnaire.UserControls.IConfigUC.Reset
        ' Clear values
        rRequired.SelectedIndex = 0
    End Sub

End Class
